package diet

import (
	"github.com/bgmp/config"
	"github.com/bgmp/middleware"
	"github.com/bgmp/model"
	"github.com/gin-gonic/gin"
)

func (b Base) GetBetween(c *gin.Context, req *NutritionBetweenRequest) []model.DietView {
	diets := model.ListDietViews(config.DB,
		map[string]any{model.Diet_UserId: middleware.GetUserId(c)},
		&model.DietSelectConditions{
			Start: req.Begin,
			End:   req.End,
		},
	)
	return diets
}

type NutritionBetweenRequest struct {
	Begin model.Time `json:"begin"`
	End   model.Time `json:"end"`
}
